import AutoImport from 'unplugin-auto-import/vite';

export default (path: any) => {
  return AutoImport({
    dts: path.resolve(__dirname, '../../types/auto-imports.d.ts'),
    vueTemplate: true,
    imports: [
      'vue',
      'vue-router',
      'pinia',
      '@vueuse/core',
      {
        'lodash-es': [
          'isString',
          'isBoolean',
          'isArray',
          'isNumber',
          'isFunction',
          'isPlainObject',
          'isEqual',
          'isNaN',
          'isNil',
          'isNull',
          'isUndefined',
          'isEmpty',
          'cloneDeep',
          'trim',
          'trimStart',
          'trimEnd',
          'merge',
          'omit',
          'pick',
          'chunk',
          'keys',
          'values',
          'camelCase',
          'kebabCase',
          'lowerCase',
          'snakeCase',
          'startCase',
          'upperCase',
          'upperFirst',
          'lowerFirst',
          'toLower',
          'toUpper',
          'groupBy',
          'debounce',
          'throttle',
          'last',
          'assign',
          'assignWith',
        ],
      },
      {
        from: 'vue',
        imports: ['Ref', 'ComputedRef', 'PropType'],
        type: true,
      },
    ],
  });
};
